<script>
    var shareData = {
        title: "<%= share.title %>",
        link: "<%= share.link %>",
        imgUrl: "<%= share.img %>",
        desc: "<%= share.desc %>"
    }
    //    weixinJsApi(function (config) {
    wx.config({
        debug: false,
        appId: '<%= wxconfig.appId %>',
        timestamp: '<%= wxconfig.timestamp %>',
        nonceStr: "<%= wxconfig.nonceStr %>",
        signature: "<%= wxconfig.signature %>",
        jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'onMenuShareQZone',
            'hideMenuItems',
            'showMenuItems',
            'hideAllNonBaseMenuItem',
            'showAllNonBaseMenuItem',
            'translateVoice',
            'startRecord',
            'stopRecord',
            'onVoiceRecordEnd',
            'playVoice',
            'onVoicePlayEnd',
            'pauseVoice',
            'stopVoice',
            'uploadVoice',
            'downloadVoice',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'getNetworkType',
            'openLocation',
            'getLocation',
            'hideOptionMenu',
            'showOptionMenu',
            'closeWindow',
            'scanQRCode',
            'chooseWXPay',
            'openProductSpecificView',
            'addCard',
            'chooseCard',
            'openCard'
        ]
    });
    wx.ready(function () {
        //分享朋友圈
        wx.onMenuShareTimeline({
            title: "<%= share.qtitle %>",
            link: "<%= share.link %>",
            imgUrl: "<%= share.img %>"
        });

        //分享给朋友
        wx.onMenuShareAppMessage(shareData);
    });

    wx.error(function (res) {

    });
    //    });
</script>